using System;
using System.Web;

namespace Framework.Library.Core.Utils.Web
{
    public class CurrentHttpContextGetter : IHttpContextGetter
    {
        #region IHttpContextGetter Members

        public HttpContext GetHttpContext()
        {
            HttpContext currentContext = HttpContext.Current;

            if (currentContext == null)
                throw new Exception("No current HttpContext.");

            return currentContext;
        }

        #endregion
    }
}